package com.hgsf.service.impl;

import com.hgsf.entity.Course;
import com.hgsf.entity.SelectedCourse;
import com.hgsf.entity.Student;
import com.hgsf.mapper.StudentMapper;
import com.hgsf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public Student studentLogin(Student s) {
        return studentMapper.querySingleStudent(s);
    }

    @Override
    public List<Map<String, String>> queryOptionCourse(long sid) {
        return studentMapper.queryOptionCourse(sid);

    }

    @Override
    public List<Vector> queryCourseToVector(long sid) {
        return null;
    }

    @Override
    public List<Vector> queryCourseByConditionToVector(String condition, long sid) {
        return null;
    }

    /**
     * 选课
     * @param course
     * @return
     */
    @Override
    public boolean selectCourse(SelectedCourse course) {
        return studentMapper.insertSelectedRecorder(course)==1;
    }

    @Override
    public List<HashMap<String,String>> querySelectedCourse(long sid) {
        return studentMapper.querySelectedCourse(sid);
    }

    @Override
    public List<Map<String, String>> querySelectedCourseToListMap(long sid) {
        return null;
    }

    @Override
    public Map<String, String> queryStudentMsg(long sid) {
        return null;
    }

    @Override
    public boolean alterStudentMsg(Student s) {
        return false;
    }

    @Override
    public boolean alterStuPsw(Student s) {
        return false;
    }

    @Override
    public int queryCourseMaxPeople(Course c) {
        return 0;
    }

    @Override
    public boolean canSelectCourse(Course c, Student s) {
        return false;
    }

    @Override
    public Student queryCompletionStuMsg(long sid) {
        return null;
    }

    @Override
    public int queryPeopleCount(Course c) {
        return 0;
    }

    @Override
    public int queryCourseCount(Student s) {
        return 0;
    }

    @Override
    public int queryMaxCourseCount(Student s) {
        return 0;
    }
}
